package com.sreManager.controller.web;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;

import com.sreManager.Constant;
import com.sreManager.controller.DefaultController;
import com.sreManager.domain.Codes;
import com.sreManager.mapper.CommonCodeMapper;

@Controller
public class CommonController extends DefaultController {
	@Autowired CommonCodeMapper codeMapper;

	@ModelAttribute("roleList")
	private List<Codes> roleList() {
		HashMap<String, Object> map = new HashMap<String, Object>();
		map.put("group", Constant.USER_ROLE);
		return codeMapper.selectCodeList(map);
	}

	@ModelAttribute("stateList")
	private List<Codes> stateList() {
		HashMap<String, Object> map = new HashMap<String, Object>();
		map.put("group", Constant.USER_STATE);
		return codeMapper.selectCodeList(map);
	}
}
